﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace MySkiPatrolEntity
{
    
    [DataContract]
    public class Error
    {
        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string Message { get; set; }

        public Error()
        { }

        public Error(string id, string message)
        {
            this.ID = id;
            this.Message = message;
        }
    }

    [DataContract]
    public enum DataAction
    {
        [EnumMember]
        View,
        [EnumMember]
        Add,
        [EnumMember]
        Update,
        [EnumMember]
        Delete
    }

    [DataContract]
    public class DataTransaction
    {
        [DataMember]
        public DataAction Action { get; set; }

        [DataMember]
        public bool Success { get; set; }

        [DataMember]
        public string PatrolPrefix { get; set; }

        [DataMember]
        public DateTimeOffset ProcessDateTime { get; set; }

        [DataMember]
        public List<Error> TransactionErrors { get; set; }

        [DataMember]
        public List<LogEntry> TransactionLog { get; set; }

        public DataTransaction()
        {
        }
    }

    [DataContract]
    public class LogEntry
    {
        public LogEntry(DateTime stamp, string message)
        {
            this.TimeStamp = stamp;
            this.Message = message;
        }

        [DataMember]
        public DateTime TimeStamp { get; set; }
        [DataMember]
        public string Message { get; set; }
    }

    [DataContract]
    public class ValueKeyPair
    {
        [DataMember]
        public string Key { get; set; }
        [DataMember]
        public string Value { get; set; }

        public ValueKeyPair(string key, string value)
        {
            this.Key = key;
            this.Value = value;
        }
    }

    

    
}
